package com.demo2do.boyle.common.entity.customer;

import com.demo2do.core.utils.Alias;

/**
 * 
 * @author Wilson
 */
@Alias("sex")
public enum Sex {
	
	All("全部"),
	
    MALE("男"),

    FEMALE("女");

    private String description;

    Sex(String description) {
        this.description = description;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    public String getName() {
        return name();
    }

    @Override
    public String toString() {
        return this.description;
    }
    
    /**
     * 
     * @param name
     * @return
     */
    public static Sex aliasOf(String name) {
		for(Sex sex : Sex.values()) {
			if(sex.getDescription().equalsIgnoreCase(name)) {
				return sex;
			}
		}
		return null;
	}

}
